Preconditioned Conjugate-Gradient Package 2 (PCG2)

©1995, 1996, Richard B. Winston

Please Register Please Register

Last modified on Wednesday, January 31, 1996 - 6:20:49 PM

Skip forward to Input instructions for the Preconditioned Conjugate-Gradient Package 2.

The original instructions for the Preconditioned Conjugate-Gradient Package 2 are on pages 13 to 14 of Hill (1990).

Introduction: The Preconditioned Conjugate-Gradient Package 2 is one of several options for solving the finite difference approximation of the fundamental equations governing groundwater flow in MODFLOW. Other options include the Strongly Implicit Procedure Package and the Slice-Successive Overrelaxation Package. The solutions obtained with any of these solvers should be similar although the time required to find the solution and the amount of memory used may differ. If you wish to use the rewetting capability of BCF2 or BCF3, the Preconditioned Conjugate Gradient Package is usually the best choice. The Slice-Successive Overrelaxation Package is usually inappropriate when the rewetting capability is active. The Strongly Implicit Procedure can be used with rewetting capability although the Preconditioned Conjugate Gradient Package is usually better for that purpose.

Two preconditioning methods may be used; "Modified Incomplete Cholesky", or "Polynomial". The Modified, Incomplete Cholesky method is best for use on scalar computers whereas the Polynomial method is better for vector computers or can be used to save computer storage. (From what I've been able to gather, PC's and Mac's are scalar computers.) Hill (1990) describes how the source code for the Preconditioned Conjugate-Gradient Package 2 can be modified to take better advantage computers with vector and parallel architecture.

There are two different types of iterations in PCG2; outer (Picard) iterations and inner iterations. As their names imply there are several inner iterations within each outer iteration. Cells can not change between wet and dry during the inner iterations.

The number of outer iterations required to reach a solution will vary depending on whether a problem is linear or non-linear. Linear problems will usually only require 1 outer iteration if the number of inner iterations is less than 50. Nonlinear problems are solved most quickly if 3-10 inner iterations occur between each outer iteration. Up to 100 outer iterations may be required. Nonlinearities occur if an aquifer is unconfined or if there is a head-dependent boundary condition which is nonlinear. The following packages have nonlinear head-dependent boundary conditions.

I have not yet determined whether the following packages include nonlinear head-dependent boundary conditions Unlike other solvers, there are two convergence criteria in PCG2. The first criterion (HCLOSE) is identical to that used in the other solvers; the maximum change in head between successive iterations must be smaller than some user-specified amount. The other criterion is unique to the PCG solvers. As I understand it, it is related to the process whereby PCG2 solves the finite difference flow equations. PCG2 takes the flow equations and changes them into a form which can be easily solved. However, the flows computed with the modified equations are not identical to those computed with the original equations. The second criterion is satisfied if the maximum difference between the flow computed with the original and modified equations between any two cells is less than RCLOSE. Both criteria must be satisfied simultaneously.

Go back to Contents.


Input Instructions

All input parameters should be right justified.

Go back to Contents.

Line 1, Spaces 1-10, MXITER, Integer

Maximum number of outer iterations per time step. For linear problems, MXITER, should be 1 unless more than 50 inner iterations are required in which case MXITER could be as large as 10. For nonlinear problems, MXITER may need to be larger but should usually be less than 100.

On each time step MODFLOW will go through a series of iterations as it approaches an acceptable solution. Sometimes, however, the program may enter an infinite loop. To prevent this, MXITER forces the program to terminate after a number of iterations. If this happens, MODFLOW has not reached a solution and the results should not be accepted as a good estimate of the groundwater flow. Instead the input needs to be modified to avoid this problem. Often the problem is with the conceptual model. You should go back and check that your conceptual model is reasonable. Drying and rewetting of cells with the BCF2 or BCF3 packages is also a frequent culprit.

Go back to Input instructions for the Preconditioned Conjugate-Gradient Package 2.


Line 1, Spaces 10-20, ITER1, Integer

Maximum number of inner iterations, Usually <=30 for linear problems, usually 3-10 for nonlinear problems.

On each time step MODFLOW will go through a series of iterations as it approaches an acceptable solution. Sometimes, however, the program may enter an infinite loop. To prevent this, ITER1 forces the program to terminate after a number of inner iterations. ITER1 is also used to force PCG2 into the next outer iteration in nonlinear problems. You shouldn't worry if inner iterations cease because ITER1 inner iterations have taken place unless you have also reached the maximum number of outer iterations as specified by MXITER. Cells can not change between wet and dry during the inner iterations

Go back to Input instructions for the Preconditioned Conjugate-Gradient Package 2.


Line 1, Spaces 21-30, NPCOND, Integer

From what I've been able to gather, PC's and Mac's are scalar computers. If you are using a computer with a vector or parallel architecture, you may wish to modify PCG2 as described by Hill (1990). If you do, you will have to recompile MODFLOW.

Go back to Input instructions for the Preconditioned Conjugate-Gradient Package 2.


Line 2, Spaces 1-10, HCLOSE, Real Number

HCLOSE is one of two convergence criteria in PCG2. When the maximum change in head between two iterations is less than HCLOSE, the program will check the other criterion (RCLOSE). If both criteria are met, the program will go on to the next outer iteration. If the criteria are both met on the first of a new set of inner iterations, the program will assume that it has obtained a sufficiently accurate solution and stop. These criteria might be incorrect if the program was approaching the solution very gradually. It is always a good idea to examine the water budget for each time step. A large error (>1%) in the water budget could indicate that the program terminated prior to reaching a solution. It could also be a problem with the General-Head Boundary Package or the Stream Package.

Go back to Input instructions for the Preconditioned Conjugate-Gradient Package 2.


Line 2, Spaces 11-20, RCLOSE, Real Number

RCLOSE is one of two convergence criteria in PCG2. It is often set to the same numeric value as HCLOSE. However, the units of the two criteria are different. The units of HCLOSE are length whereas the units for RCLOSE are length^3/time. When the maximum absolute flow residual is less than RCLOSE, the program will check HCLOSE. If both criteria are met, the program will go on to the next outer iteration. If the criteria are both met on the first of a new set of inner iterations, the program will assume that it has obtained a sufficiently accurate solution and stop. These criteria might be incorrect if the program was approaching the solution very gradually. It is always a good idea to examine the water budget for each time step. A large error (>1%) in the water budget could indicate that the program terminated prior to reaching a solution. It could also be a problem with the General-Head Boundary Package or the Stream Package.

Go back to Input instructions for the Preconditioned Conjugate-Gradient Package 2.


Line 2, Spaces 21-30, RELAX, Real Number

The relaxation parameter is usually set to 1. However, if you are using the rewetting capability in BCF2 or BCF3, you may wish to set it to 0.97 to 0.99 because this may prevent zero divide and non-diagonally dominant matrix errors. RELAX is used only if NPCOND=1.

Go back to Input instructions for the Preconditioned Conjugate-Gradient Package 2.


Line 2, Spaces 31-40, NBPOL, Integer

If NBPOL=2, the estimate of the upper bound on the maximum eigenvalue is 2, otherwise the estimate will be calculated. In many cases you can speed up execution time slightly by setting NBPOL=2. The estimated value is usually close to 2 and the number of iterations required is relatively insensitive to the exact value of the estimate. Thus by setting the value to 2, you can save the time that would have been spent on making the estimate. NBPOL is used only if NPCOND=2.

Go back to Input instructions for the Preconditioned Conjugate-Gradient Package 2.


Line 2, Spaces 41-50, IPRPCG, Integer

Printout interval. At the end of every IPRPCG iterations, the maximum head change between iterations will be printed. Thus, if IPRPCG is 3, the maximum head change between iterations will be printed at the end of the 3'rd, 6'th, 9'th, etc. iterations. If IPRPCG is set to 0 it will be changed to 999. The maximum head change is also printed at the end of each stress period regardless of the value of IPRPCG. Presumably this refers to inner iterations although this is not clear from the original documentation.

Go back to Input instructions for the Preconditioned Conjugate-Gradient Package 2.


Line 2, Spaces 51-60, MUTPCG, Integer

MUTPCG is used to suppress printing. Based on an examination of the source code MUTPCG will act in the following way. The original documentation differs slightly from the above. According to the original documentation: Go back to Input instructions for the Preconditioned Conjugate-Gradient Package 2.

Line 2, Spaces 61-70, IPCGCD, Integer

I find the original documentation unclear and have not yet analyzed the source code for this variable. The original documentation states
"IPCGCD -- is a flag which is used when NPCOND=1 to control whether the same Cholesky decomposition may be used for multiple calls to PCG2AP. IPCGCD should be zero for most applications. However, future packages might benefit from nonzero values of IPCGCD."
What is unclear is whether a zero or a nonzero value allows the same Cholesky decomposition to be used.

Go back to Input instructions for the Preconditioned Conjugate-Gradient Package 2.
Go back to Contents.



©1995, 1996, Richard B. Winston,
rwinsto@lsuvm.sncc.lsu.edu
Dept. of Geology and Geophysics
Louisiana State University
Baton Rouge, La 70803
U.S.A.
504-388-2337
Fax 504-388-2302
http://scribe.geol.lsu.edu/rbwinston.html
ftp://aapg.geol.lsu.edu/pub/winston